# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager

__author__ = 'nibo'

app = Flask(__name__)

# region 日志设置
import logging
from logging import Formatter
fmt = '%(asctime)s %(filename)s[line:%(lineno)-3d] %(levelname)-7s %(message)s'
file_handler = logging.FileHandler('app.log', encoding='utf-8')
file_handler.setFormatter(Formatter(fmt))
app.logger.addHandler(file_handler)
app.logger.setLevel(logging.DEBUG)
# endregion


app.config.from_object('config')

db = SQLAlchemy(app)

lm = LoginManager(app)
# lm.login_view = 'login'
lm.login_message = u'请先登录'

from app import views, models
